import React, { Fragment } from 'react';
import { Form } from 'antd';
import LimitInput from '@/components/LimitInput';
import UserSelect from '@/containers/select/EmployeeSelect';

// 修改处理人表单
const Designate = ({ form, data }) => {
    const { getFieldDecorator } = form;
    const { assignEmployeeList = [] } = data || {};

    return (
        <Fragment>
            <Form.Item label="现有处理人" style={{ margin: '14px 0' }}>
                {assignEmployeeList.length > 0 ? assignEmployeeList.map(item => item.employeeName).join('、') : '-'}
            </Form.Item>
            <Form.Item label="修改处理人">
                {getFieldDecorator('beAssignedEmployeeCode', {
                    rules: [
                        {
                            required: true,
                            message: '请选择'
                        }
                    ]
                })(<UserSelect popupForBody defaultInitData></UserSelect>)}
            </Form.Item>
            <Form.Item label="修改原因">
                {getFieldDecorator('reason')(<LimitInput area rows={4} placeholder="请输入" maxLength={4000} />)}
            </Form.Item>
        </Fragment>
    );
};

export default Designate;
